package com.zy.cat.entity.game;


import java.time.LocalDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.common.utils.TJKUtils;
import com.zy.cat.entity.game.resp.CVSInfoResp;
import com.zy.cat.entity.primary.CVSInfoPrimary;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @info 9趣猫神奇便利店每日中奖数据记录实体类
 * @author Link
 * @date 2019-10-30 09:14
 */
@Entity
@Table(name = "zy_cat_game_cvs_daily_history", indexes = {
		@Index(name = "pid", columnList = "pid"),
		@Index(name = "ctime", columnList = "ctime"),
		@Index(name = "stime", columnList = "stime"),
		@Index(name = "etime", columnList = "etime")})
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("9趣猫神奇便利店每日数据记录实体类")
@IdClass(CVSInfoPrimary.class)
public class CVSInfo {
	
	@Id
	@Column(columnDefinition = "VARCHAR(20) NOT NULL  COMMENT '用户账号ID[9趣猫神奇便利店每日数据记录实体类]'")
	@ApiModelProperty(value = "用户账号ID", example = "fe53d6a4fa29641")
	private String pid;
	
	@Id
	@Column(columnDefinition = "VARCHAR(10) NOT NULL  COMMENT '创建时间'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22")
	private String ctime;
	
	@Column(columnDefinition = "VARCHAR(10) DEFAULT '-'  COMMENT '周期开始时间'")
	@ApiModelProperty(value = "周期开始时间", example = "2019-02-22")
	private String stime;
	
	@Column(columnDefinition = "VARCHAR(10) DEFAULT '-'  COMMENT '周期结束时间'")
	@ApiModelProperty(value = "周期结束时间", example = "2019-02-28")
	private String etime;
	
	@Column(columnDefinition = "BIGINT(10) DEFAULT '0' COMMENT '本周期抽奖次数-额外奖励进度'")
	@ApiModelProperty(value = "本周期抽奖次数-额外奖励进度", example = "1")
	private int wdcount;
	
	@Column(columnDefinition = "BIGINT(3) DEFAULT '0' COMMENT 'iPhone已获得碎片数'")
	@ApiModelProperty(value = "iPhone已获得碎片数", example = "1")
	private int iPhone;

	@Column(columnDefinition = "BIGINT(3) DEFAULT '0' COMMENT '小米平衡车已获得碎片数'")
	@ApiModelProperty(value = "小米平衡车已获得碎片数", example = "1")
	private int mbike;

	@Column(columnDefinition = "BIGINT(3) DEFAULT '0' COMMENT '九阳榨汁机已获得碎片数'")
	@ApiModelProperty(value = "九阳榨汁机已获得碎片数", example = "1")
	private int jiuyang;

	@Column(columnDefinition = "BIGINT(3) DEFAULT '0' COMMENT '优酷会员已获得碎片数'")
	@ApiModelProperty(value = "优酷会员已获得碎片数", example = "1")
	private int youku;

	@Column(columnDefinition = "BIGINT(3) DEFAULT '0' COMMENT '小米扫地机器人已获得碎片数'")
	@ApiModelProperty(value = "小米扫地机器人已获得碎片数", example = "1")
	private int srobot;
	
	@Column(columnDefinition = "BIGINT(3) DEFAULT '0' COMMENT '9999现金豆红包已获得碎片数'")
	@ApiModelProperty(value = "9999现金豆红包已获得碎片数", example = "1")
	private int xbeans;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后更新时间'")
	@ApiModelProperty(value = "最后更新时间", example = "2019-02-22 10:10:10")
	private String ltime;
 
	public CVSInfo(CVSInfoResp cvsInfoResp) {
		super();
		this.pid = cvsInfoResp.getPid();
		this.ctime = LocalDate.now().toString();
		this.stime = cvsInfoResp.getStime();
		this.etime = cvsInfoResp.getEtime();
		this.wdcount = cvsInfoResp.getWdcount();
		this.iPhone = cvsInfoResp.getIphone();
		this.mbike = cvsInfoResp.getMbike();
		this.jiuyang = cvsInfoResp.getJiuyang();
		this.youku = cvsInfoResp.getYouku();
		this.srobot = cvsInfoResp.getSrobot();
		this.xbeans = cvsInfoResp.getXbeans();
		this.ltime = TJKUtils.DateTime();
	}
	
	
}
